package com.ajl.wx.config;

import com.ajl.wx.beans.vo.ClientConfigurationMap;
import com.ajl.wx.global.ClientConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * ApplicationRunnerInit
 */
@Component
public class ApplicationRunnerInit implements ApplicationRunner {
    @Autowired
    WebApplicationProperties webApplicationProperties;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        /**
         * 视频图片使用oss，需要给小程序返回动态返回oss地址。
         *
         *  ClientConfig.clientConfigurationMap是给小程序的配信息。
         */
        ClientConfig.clientConfigurationMap=new ClientConfigurationMap<>()
                .ossUrl(webApplicationProperties.getOssUrl());
    }
}
